package fun.codedesign.jdk.util.date;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateDemo2 {
    public static void main(String[] args) {
        long time = 0;
        Date date = new Date();
        date.setTime(time);
        System.out.println(date);

        Calendar c = new GregorianCalendar();
        c.setTime(date);

        c.add(Calendar.DAY_OF_YEAR, -1);

        //2.Calendar --> Date --> long
        Date d = c.getTime();
        long l = d.getTime();
        System.out.println(l);
        System.out.println(1000 * 3600 * 24);
    }
}
